﻿<?php get_header(); ?>				
				
				<?php 
					 wp_reset_query();
					 $cat=get_category_by_slug('courses');
	
					 $args = array(
							'category__in'=>array($cat->cat_ID),
					 		'showposts'=>3,
							 'order'=>'DESC',
						 		'meta_key' => 'important',
   								'orderby' => 'meta_value_num',
								 meta_query => array(
								        array(
								            'key' => 'important',
								            'value' => '0',
								            'compare' => '>'
								        )
							        )
						);						
					 query_posts($args);
					?>
					<div class="hidden"><h1>Thẩm mỹ viện</h1></div>
					<div class="box1">
						<div class="box-title"><a href="<?php echo home_url('/category/courses')?>">Chương trình đào tạo</a></div>
						
						<?php while(have_posts()):the_post();?>
						<div style="margin-top:20px;">					
							<div id="service-item<?php echo $i?>" class="box-image-cover service-item" style="<?php if($i%2==0)echo 'margin-right:0;';?>">
								<div class="box-image" style="margin-right:0px;" ><a href="<?php echo the_permalink()?>"><img alt="<?php the_title();?>" title="<?php the_title();?>" src="<?php echo get_site_url().post_custom('image')?>" /></a></div>
								<div class="box-image-title"><a href="<?php echo the_permalink()?>"><h3><?php the_title();?></h3></a></div>
							</div>
						<div class="clear"></div></div>			
						<?php endwhile; ?>
						
					</div>
					
					<?php 
					 wp_reset_query();
					 $cat=get_category_by_slug('services');
					 //testdsf
					 $args = array(
							'category__in'=>array($cat->cat_ID),
					 		'showposts'=>3,
					 		'order'=>'DESC',
						 		'meta_key' => 'important',
   								'orderby' => 'meta_value_num',
								 meta_query => array(
								        array(
								            'key' => 'important',
								            'value' => '0',
								            'compare' => '>'
								        )
							        )
						);						
					 query_posts($args);
					 $i=0;				
					?>
					
					
					<div class="box1">
						<div class="box-title"><a href="<?php echo home_url('/category/services')?>">Dịch vụ làm đẹp</a></div>
						<?php while(have_posts()):the_post();?>
						<div style="margin-top:20px;">					
							<div id="service-item<?php echo $i?>" class="box-image-cover service-item" style="<?php if($i%2==0)echo 'margin-right:0;';?>">
								<div class="box-image" style="margin-right:0px;" ><a href="<?php echo the_permalink()?>">
									<img alt="<?php the_title();?>" title="<?php the_title();?>" src="<?php echo get_site_url().post_custom('image')?>" />
								</a></div>
								<div class="box-image-title"><a href="<?php echo the_permalink()?>"><h3><?php the_title();?></h3></a></div>
							</div>
						<div class="clear"></div></div>	
						<?php endwhile; ?>
						<div class="clear" style="height:20px;"></div>
						
						<div></div>
					</div>
					
					<div class="box2">
					
						<div class="box-title"><a href="<?php echo home_url('/category/video')?>">video nổi bật</a></div>
						<div style="margin-top:20px;">
						
						<?php 
						//testfd
						 wp_reset_query();
						 $cat=get_category_by_slug('video');
						 
						 $args = array(
								'category__in'=>array($cat->cat_ID),
						 		'showposts'=>3,
						 		'order'=>'DESC',
						 		'meta_key' => 'important',
   								'orderby' => 'meta_value_num',
								 meta_query => array(
								        array(
								            'key' => 'important',
								            'value' => '0',
								            'compare' => '>'
								        )
							        )
							);						
						 query_posts($args); 
						 			
						?>
						<?php while(have_posts()):the_post();$important_video_id=$post->ID;?>
							<div class="box-image-cover" style="margin:auto;width:auto;">
								<div class="box-image"><a href="<?php echo the_permalink()?>"><img style="width:240px;height:auto;" alt="<?php the_title();?>" title="<?php the_title();?>" src="<?php echo get_site_url().post_custom('image')?>" /></a></div>
								<div class="box-image-title"><a href="<?php echo the_permalink()?>"><h3><?php the_title();?></h3></a></div>
							</div>							
							<div class="clear" style="height:20px;"></div>
						<?php endwhile;?>	
						
							
							
							
						
							
						</div>
						
						<div style="margin-top:20px;">
						<a href="https://www.facebook.com/thammyvienthaotiencom">
							<img id="fblike" width="240" alt="Like facebook" title="Like facebook" src="<?php echo get_template_directory_uri().'/images/facebook_like_logo.png'?>" />
							</a>
						</div>
						<div id="supportonline" style="margin-top:20px;">
						<center><b id="supporttitle">Hỗ trợ trực tuyến</b></center>
						<a href="ymsgr:sendim?thaotien.beauty">
							<img id="ymsupport" alt="Hỗ trợ trực tuyến" title="Hỗ trợ trực tuyến" src="<?php echo get_template_directory_uri().'/images/support.jpg'?>" />
							
							</a>
							<span id="yhtitle">Yahoo:</span> <a href="mailto:thaotien.beauty@yahoo.com">thaotien.beauty@yahoo.com</a><br />
							Vui lòng gọi: (08) 3 957 0742
						</div>
					</div>
					<div class="clear"></div>
							
<?php get_footer(); ?>